﻿<UserControl x:Class="DaphneTranslatorWPF.View.LanguageTreeControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <TreeView ItemsSource="{Binding Items}">
            <TreeView.ItemTemplate>
                <HierarchicalDataTemplate ItemsSource="{Binding Items}">
                    <TextBlock Text="{Binding Title}">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding Path=IsPrimaryCulture}" Value="true" >
                                        <Setter Property="Background" Value="White" />                                                               
                                        <Setter Property="Foreground" Value="Black" />
                                        <Setter Property="FontWeight" Value="Bold" />
                                    </DataTrigger>
                                    
                                </Style.Triggers>                                
                            </Style>                                                           
                        </TextBlock.Style>
                        <TextBlock.ContextMenu>
                           <ContextMenu ItemsSource="{Binding Path=ContextMenuItemList}" >                    
                               <ContextMenu.ItemTemplate>
                                   <DataTemplate>
                                       <MenuItem  Header="{Binding Path=Title}" Command="{Binding Path=Command}" Icon="{x:Null}" />
                                   </DataTemplate>                                   
                               </ContextMenu.ItemTemplate>                               
                           </ContextMenu>      
                        </TextBlock.ContextMenu>                            
                    </TextBlock>
                </HierarchicalDataTemplate>
            </TreeView.ItemTemplate>
            
        </TreeView>
                  
            
    </Grid>
</UserControl>
